<?php
/**
 * 创建模型类
 * 
 * 类名
 * ml_model_db...后面接自己的名字，驼峰写法
 *
 * 
 */
class ml_model_dbSysNoticeContent extends Lib_datamodel_db 
{
    
/**
 * 创建构造函数
 *
 */
    function __construct()
    {
        $db_config = ml_factory::load_standard_conf('db');
        parent::__construct('sys_notice_content' , $db_config['sys_notice_content']);
    }

    public function addNotice($content)
    {
        if(!$this->init_db('', self::DB_MASTER))
        return false;
        
        $aData = array(
            'content' => $content
        );
        $this->insert($aData);
    }
    
    public function get_in_id($aId)
    {
        if(!$this->init_db('', self::DB_SLAVE ))
            return false;
            
        $sql = 'select * from '.$this->table.' where content_id in ('.implode(',' , $aId).') order by ctime desc';
        return $this->fetch($sql);
    }
}